﻿using System;

namespace Ec_System.Models.Web
{
    public partial class CustomerAdressData
    {
        public Int32 ID { get; set; }
        public String Zip { get; set; }
        public String LoginID { get; set; }
        public string Province_ID { get; set; }
        public string City_ID { get; set; }
        public String AdressMain { get; set; }
        public String AdressExt { get; set; }
        public String PhoneNum { get; set; }
        public String TelNum { get; set; }
        public string Town_ID { get; set; }
        public String Recever { get; set; }
    }

    public partial class CustomerAdressData
    {
        public string ProvinceName { get; set; }

        public string CityName { get; set; }

        public string TownName { get; set; }

        public string ShippingAdress_ID { get; set; }

        /// <summary>
        /// 判断是否为主收货地址
        /// </summary>
        public string IsMainAddress
        {
            get
            {
                if (string.IsNullOrWhiteSpace(ShippingAdress_ID))
                    return "";
                else
                    return "checked=\"checked\"";
            }
        }
        
        public string FullAddress
        {
            get
            {
                return string.Format("{0}-{1}-{2} {3}", this.ProvinceName, CityName, TownName, this.AdressMain);
            }
        }
    }
}
